import [Value,Scope]
import structs/ArrayList

Number : class extends Value {
    iValue : Int
    dValue : Double
    
    int? := true
    toString : func -> String {
        (int?) ? iValue toString() : dValue toString()
    }
    
    init : func ~withIntWithoutLine(=iValue) { int? = true }
    init : func ~withIntWithLine(=iValue,=line) { int? = true }
    init : func ~withFloatWithoutLine(=dValue) { int? = false }
    init : func ~withFloatWithLine (=dValue, =line) { int? = false }
    
    equals? : func(other : Value) -> Bool {
        if(int?) {
            return other class == This && other as This int? && other as This iValue == this iValue
        } else {
            return other class == This && !other as This int? && other as This dValue == this dValue
        }
    }
    
}